﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using KeRui.Common;
using System.Collections.Generic;

public partial class Manage_Cms_VoteItemLook : System.Web.UI.Page
{
    public List<KeRui.Model.CmsVoteItem> list;
    public int VoteID = PageRequest.GetInt("VoteID",-1);
    public int Total = 0;
    public string Title = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        KeRui.BLL.CmsVote bllCmsVote = new KeRui.BLL.CmsVote();
        KeRui.Model.CmsVote ModelCmsVote = new KeRui.Model.CmsVote();
        KeRui.BLL.CmsVoteItem bllCmsVoteItem = new KeRui.BLL.CmsVoteItem();
        list = bllCmsVoteItem.GetList(VoteID.ToString());
        Total = bllCmsVoteItem.GetSum(VoteID);
        ModelCmsVote = bllCmsVote.GetModel(VoteID);
        Title = ModelCmsVote.Content;
    }

    protected string getPercent(int num,int Total)
    {
        double Percent = 100 * (double.Parse(num.ToString()) / double.Parse(Total.ToString()));
        return Percent.ToString("n2")+"%";
    }

    protected string getWidth(int num, int Total)
    {
        double Width = (double.Parse(num.ToString()) / double.Parse(Total.ToString())) * 500;
        return Width.ToString("n2");
        
    }
}
